<layout name="popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<div class="popup-header">
		<h1>奖励红包</h1>
		<i class="mid"></i>
		<a class="btn btn-normal" onclick="save();">确定</a>
		<a class="btn btn-return" onclick="close_popup();">取消</a>
	</div>
	<div class="popup-body">
		<div class="popup-body-scroll">
			<div class="popup-content">
				<form id="form_data" name="form_data" method="post" >
					<input type="hidden" name="talk_id" id="talk_id" value="">
					<input type="hidden" name="opmode" id="opmode" value="add">
					<div class="box">
						<label class="input-label" for="send_name">发送者名称*：</label>
						<input class="input w19" type="text" id="send_name" name="send_name" check="required" info="请输入红包祝福语" >
					</div>
					<div class="box">
						<label class="input-label" for="amount">金额：</label>
						<input class="input w19" type="text" id="amount" name="amount" check="required" info="请输入金额" >
					</div>
					<div class="box">
						<label class="input-label" for="act_name">活动名称*：</label>
						<input class="input" type="text" id="act_name" name="act_name" check="required" info="请输入活动名称" >
					</div>
					<div class="box">
						<label class="input-label" for="wishing">红包祝福语*：</label>
						<input class="input" type="text" id="wishing" name="wishing" check="required" info="请输入红包祝福语" >
					</div>

					<div class="box">
						<label class="input-label" for="remark">备注*：</label>
						<textarea class="textarea" id="remark" name="remark"  ></textarea>
					</div>
				</form>
			</div>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);
		layui.use(['global'], function() {
			var fn = {
				save : function() {
					$talk_id = $('#talk_list .chat-user.active', parent.document).attr('data');
					$("#talk_id").val($talk_id);
					send_form('form_data', '{:url("send_hb")}', '', function(ret) {
						if (ret.status == 1) {
							parent.layer.msg(ret.info, {
								time : 1200
							}, function() {
								parent.layer.close(index);
								parent.location.reload(true);
							});
						} else {
							parent.layer.msg(ret.info);
							return false;
						};
					});
				},
				close_popup : function() {
					parent.layer.close(index);
				},
				select_pid : function() {
					winopen("{:url('select_pid')}", 560, 470);
				},
			};
			win_exp(fn);
		});
	</script>
</block>